package com.openbravo.data.user;

import java.util.Comparator;
import java.util.List;
import com.openbravo.data.basic.BasicException;

public interface I_BrowsableEditableData<T> {
    int ST_DELETE = 2;
    int ST_INSERT = 3;
    int ST_NORECORD = 0;
    int ST_UPDATE = 1;


    void actionDelete() throws BasicException;

    void actionInsert() throws BasicException;

    void actionLoad() throws BasicException;

    void addBrowseListener(BrowseListener l);

    void addEditorListener(EditorListener l);

    void addStateListener(StateListener l);

    boolean canDeleteData();

    boolean canInsertData();

    boolean canLoadData();

    boolean canUpdateData();

    int findNext(Finder f) throws BasicException;

    T getCurrentElement();

    int getIndex();

    int getState();

    boolean isAdjusting();

    void loadData() throws BasicException;
    
    void loadData(List<T> datas) throws BasicException;

    void moveFirst() throws BasicException;

    void moveLast() throws BasicException;

    void moveNext() throws BasicException;

    void movePrev() throws BasicException;

    void moveTo(int i) throws BasicException;

    void refreshCurrent();

    void refreshData() throws BasicException;


    void saveData() throws BasicException;

    void setEditable(boolean value);

    void unloadData() throws BasicException;
    
    void sort(Comparator c) throws BasicException;
}
